@prefix-cls: ~'inbiz-component-permission-config';

.@{prefix-cls} {
  width: 100%;
}

.inbiz-component-permission-config-modal {
  height: 400px;

  .pane-model,
  .pane-page {
    height: 341px;
    overflow: hidden;

    :global {
      .ant-table {
        border: 1px solid #eee;
      }

      .ant-table-title {
        border-bottom: 1px solid #eee;
      }
    }
  }

  .pane-action {
    display: flex;
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;

    .left-content-page {
      .left-content-list-page {
        display: flex;
        align-items: center;
        height: 32px;
        padding: 0 10px 0 13px;
        overflow: hidden;
        color: #666;
        background-color: #fafafa;
        cursor: pointer;
        white-space: nowrap;

        >span {
          flex: 1;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }

      .left-content-list-item {
        display: flex;
        align-items: center;
        height: 32px;
        padding: 0 10px 0 30px !important;
      }
    }

    .left-content {
      display: flex;
      flex-direction: column;
      width: 185px;
      height: 100%;
      border-right: 1px solid #ddd;

      .left-content-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 53px;
        padding: 0 10px 0 14px;
        border-bottom: 1px solid #ddd;

        >span {
          font-size: 14px;
        }

        >div {
          color: var(--inbiz-color-primary);
          font-size: 12px;
          cursor: pointer;
        }
      }

      .left-content-list {
        flex: 1;
        overflow-y: auto;

        .left-content-list-item {
          display: flex;
          align-items: center;
          height: 32px;
          padding: 0 10px 0 13px;
          overflow: hidden;
          color: #666;
          cursor: pointer;

          &-active {
            // color: var(--inbiz-color-primary);
            background-color: #e7f3ff;

            &:hover {
              background-color: #e7f3ff !important;
            }
          }

          >span {
            flex: 1;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
          }

          >div {
            display: none;
            width: 14px;
            cursor: pointer;

            &:hover {
              color: var(--inbiz-color-primary);
            }
          }

          &:hover {
            background-color: #fafafa;

            &>div {
              display: block;
            }
          }
        }
      }
    }

    .right-content {
      flex: 1;
      overflow: hidden;

      .table-title-nav {
        display: flex;
        justify-content: space-between;
      }

      :global {
        .ant-table-title {
          padding: 10px 16px;
          border-top: none;
          border-right: none;
          border-bottom: 1px solid #ddd;
          border-left: none;
        }

        .ant-table-tbody>tr>td:first-child,
        .ant-table-thead>tr>th:first-child {
          padding: 0 !important;
        }

        .ant-table-tbody>tr.ant-table-row-selected>td {
          background: #e7f3ff;
        }

        .ant-table-tbody>tr.ant-table-row-selected:hover>td {
          background: #e7f3ff;
        }

        .ant-table-tbody>tr:last-child>td {
          border-color: #f0f0f0;
        }

        .ant-table-placeholder>td {
          border-bottom: none;
        }

        .editable-cell {
          position: relative;
        }

        .ant-table-header .ant-table-cell {
          padding: 10px;
        }

        .ant-table-body .ant-table-cell {
          padding: 5px;
        }

        .editable-cell-value-wrap {
          min-height: 32px;
          padding: 5px 12px;
          cursor: pointer;
        }

        .editable-cell-value-wrap:hover {
          padding: 4px 11px;
          border: 1px solid #d9d9d9;
          border-radius: 2px;
        }

        .editable-cell-value-wrap-disabled {
          cursor: auto;
        }

        .editable-cell-value-wrap-disabled:hover {
          border-color: transparent;
        }

        .ant-table.ant-table-bordered>.ant-table-container {
          border-left: none;
        }

        .ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table,
        .ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table {
          border-top: none;
        }
      }
    }
  }

  :global {
    .ant-table-tbody .ant-table-measure-row>td:first-child {
      padding: 0 !important;
    }

    .ant-table-tbody>tr>td:first-child,
    .ant-table-thead>tr>th:first-child {
      padding: 8px 0 8px 16px !important;
    }

    .ant-table-tbody>tr:last-child>td {
      border-color: transparent;
    }

    .ant-table-body {
      overflow-y: auto !important;
      scrollbar-width: thin;
    }

    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    ::-webkit-scrollbar-thumb {
      background-color: rgba(0, 0, 0, 0.1);
      border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background-color: rgba(0, 0, 0, 0.2);
    }
  }
}

.inbiz-component-permission-config-modal-picker {
  height: 383px;

  :global {
    .ant-table-tbody>tr.ant-table-row-selected>td {
      background: #e7f3ff;
    }

    .ant-table-tbody>tr.ant-table-row-selected:hover>td {
      background: #e7f3ff;
    }

    .ant-table-tbody .ant-table-measure-row>td:first-child {
      padding: 0 !important;
    }

    .ant-table-tbody>tr>td:first-child,
    .ant-table-thead>tr>th:first-child {
      padding: 8px 0 8px 16px !important;
    }

    .ant-table-tbody>tr:last-child>td {
      border-color: transparent;
    }

    .ant-input-affix-wrapper {
      width: 250px;
      margin-bottom: 20px;

      svg {
        font-size: 16px;
      }
    }

    .ant-table {
      overflow: hidden;
      border: 1px solid #eee;
    }

    .ant-table-body {
      overflow-y: auto !important;
      scrollbar-width: thin;

      .ant-table-row {
        cursor: pointer;
      }
    }

    .ant-input-clear-icon.ant-input-clear-icon-has-suffix {
      height: 16px;
    }

    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    ::-webkit-scrollbar-thumb {
      background-color: rgba(0, 0, 0, 0.1);
      border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background-color: rgba(0, 0, 0, 0.2);
    }
  }
}

.inbiz-component-permission-config-page-picker {
  display: flex;
  flex-direction: column;
  height: 100%;

  .content {
    display: flex;
    height: 100%;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;

    .left-tree {
      width: 185px;
      height: 100%;
      font-size: 12px;
      background-color: #fff;
      border-right: solid 1px #ddd;

      >p {
        display: flex;
        align-items: center;
        width: 100%;
        height: 40px;
        margin-bottom: 0;
        padding: 0 8px;
        cursor: pointer;

        .app-name {
          margin-left: 6px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
      }

      .app-selected {
        // background-color: var(--ant-primary-1);
        background-color: #e7f3ff;
      }

      .app-selected:hover {
        // background-color: var(--ant-primary-color-active-deprecated-d-02);
        background-color: #e7f3ff;
      }

      .left-group-box {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        scrollbar-width: thin;

        .group-item {
          display: flex;
          align-items: center;
          width: 100%;
          height: 32px;
          margin-bottom: 0;
          padding: 0 8px 0 30px;
          overflow: hidden;
          cursor: pointer;

          .group-name {
            margin-left: 6px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
          }

          &:hover {
            background-color: rgba(0, 0, 0, 0.02);
          }
        }

        .group-item-child {
          padding: 0 8px 0 52px;
        }

        .active {
          // background-color: var(--ant-primary-1);
          background-color: #e7f3ff;
        }

        .active:hover {
          // background-color: var(--ant-primary-color-active-deprecated-d-02);
          background-color: #e7f3ff;
        }

        :global {
          .ant-tree .ant-tree-treenode {
            position: relative;
            width: 100%;
            padding: 4px 0;

            .ant-tree-title {
              margin-left: 6px;
              color: #000;
              font-size: 12px;
            }

            &::before {
              position: absolute;
              display: block;
              height: 32px;
              transition: background-color 0.3s;
              content: '';
              pointer-events: none;
              inset: 0 0 4px;
              left: 0;
              right: 0;
              top: 0;
              bottom: 0;
            }

            .ant-tree-node-content-wrapper {
              flex: 1;
              padding: 0 4px 0 0;
              overflow: hidden;
              white-space: nowrap;
              text-overflow: ellipsis;
            }
          }

          .ant-tree .ant-tree-treenode.ant-tree-treenode-selected {
            &::before {
              background: #e7f3ff;
            }

            &:hover::before {
              background: #e7f3ff;
            }
          }

          .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
            background-color: transparent;
          }

          .ant-tree .ant-tree-treenode:hover::before {
            background: #f5f5f5;
          }

          .ant-tree-switcher .ant-tree-switcher-icon svg {
            fill: #aaa;
          }

          .ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 14px;
            color: #1989fa;
            color: var(--inbiz-color-primary);
            font-size: 16px;
          }

          .ant-tree-indent-unit {
            width: 14px;
          }
        }
      }

      :global {
        .ant-spin-nested-loading {
          height: calc(100% - 40px);
        }
      }
    }

    .right-nav {
      display: flex;
      flex: 1;
      flex-direction: column;

      .right-title {
        :global {
          .ant-input-affix-wrapper .ant-input {
            font-size: 12px;
            line-height: 22px;
          }

          .ant-input-affix-wrapper svg {
            font-size: 16px;
          }

          .ant-checkbox-wrapper {
            font-size: 12px;
          }
        }
      }

      .page-list {
        flex: 1;
        width: 573px;
        margin-top: 10px;

        :global {
          .ant-table-wrapper {
            height: 100%;

            .ant-table-header {
              font-size: 12px;

              .ant-table-thead>tr>th {
                color: #666;
              }
            }

            .ant-table-body {
              font-size: 12px;

              .ant-table-tbody>tr>td {
                height: 40px;
              }
            }
          }

          .ant-table-tbody>tr.ant-table-row-selected>td {
            background: #e7f3ff;
          }

          .ant-table-tbody>tr.ant-table-row-selected:hover>td {
            background: #e7f3ff;
          }
        }
      }

      :global {
        .ant-input-affix-wrapper {
          width: 260px;
          margin: 10px 10px 0 10px;
        }

        .ant-empty {
          margin-top: 80px;
        }

        .ant-spin-nested-loading {
          flex: 1;
        }

        .ant-table-placeholder {
          >td {
            border-color: transparent;
          }
        }

        .ant-spin-container {
          display: flex;
          flex-direction: column;
          height: 100%;
        }

        .ant-table-tbody .ant-table-row {
          cursor: pointer;
        }
      }
    }
  }

  .checked-list {
    height: 100px;
    min-height: 100px;
    padding: 13px 0;
    overflow: hidden auto;

    .checked-item {
      display: inline-block;
      height: 24px;
      margin: 0 10px 5px 0;
      padding: 3px 8px;
      font-size: 12px;
      background-color: #f8f8f8;
      border-radius: 2px;

      :global {
        .anticon-close-circle {
          margin-left: 5px;
          color: #c7c7c7;
          font-size: 13px;
          cursor: pointer;
        }
      }
    }
  }

  :global {
    .ant-spin-nested-loading {
      flex: 1;

      .ant-spin-container {
        height: 100%;
      }
    }

    .ant-table-header {
      border-top: 1px solid #f0f0f0;
    }

    .ant-table-tbody>tr>td:first-child,
    .ant-table-thead>tr>th:first-child {
      padding-left: 13px !important;
    }

    .ant-table-body {
      overflow-y: auto !important;
      scrollbar-width: thin;
    }
  }
}

.page-select-model-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .select-count-nav {
    >p {
      margin-bottom: 0;

      >span {
        color: var(--inbiz-color-primary);
      }

      :global {
        .anticon-down {
          color: #262626;
          transition: all ease 0.3s;
        }
      }
    }
  }
}

.action-self-nav {
  min-height: 328px;

  :global {
    .ant-table-tbody>tr.ant-table-row-selected>td {
      background: #e7f3ff;
    }

    .ant-table-tbody>tr.ant-table-row-selected:hover>td {
      background: #e7f3ff;
    }

    .ant-table {
      border-top: 1px solid #ddd;
      border-right: 1px solid #ddd;
      border-left: 1px solid #ddd;
    }

    .ant-input-affix-wrapper {
      width: 260px;
      margin-bottom: 20px;

      svg {
        font-size: 16px;
      }
    }

    .ant-table-tbody .ant-table-measure-row>td:first-child {
      padding: 0 !important;
    }

    .ant-table-tbody>tr>td:first-child,
    .ant-table-thead>tr>th:first-child {
      padding: 8px 0 8px 16px !important;
    }

    .ant-table-tbody .ant-table-row {
      cursor: pointer;
    }

    .ant-input-clear-icon.ant-input-clear-icon-has-suffix {
      height: 16px;
    }
  }
}

.pane-action-dropdown {
  :global {
    .ant-dropdown-menu {
      padding: 0;
    }

    .ant-dropdown-menu-item {
      padding: 0;

      >span {
        display: flex;

        >span {
          padding: 5px 12px;
          font-size: 13px;
        }
      }
    }
  }
}